# -*- coding: utf-8 -*-
from docx import Document
from docx.shared import Inches, Cm
document = Document()
sections=document.sections
print len(sections)
for section in sections:
    print section.start_type
table = document.add_table(rows=4, cols=2)
hdr_cells = table.columns[0].cells
hdr_cells[0].text = u'光缆编码'
hdr_cells[1].text = u'光缆名称'
hdr_cells[2].text = u'光缆规格'
hdr_cells[3].text = u'施工日期'
document.add_picture('386.png', width=Cm(2.65))
section=sections[0]
print section.left_margin, section.right_margin
print section.top_margin, section.bottom_margin
print section.gutter
print section.orientation, section.page_width, section.page_height
section.page_width=Cm(8.56)
section.page_height=Cm(5.4)
section.left_margin=Cm(0.3)
section.right_margin=Cm(0.3)
section.top_margin=Cm(0.3)
section.bottom_margin=Cm(0.3)

# document.add_page_break()

document.save('386.docx')
